<div class="bs-callout bs-callout-info">
    <h4>Services</h4>
    <p><a href="<?php echo base_url().'admin/services/add'; ?>">+ Add new services</a></p>
</div>

<select id="parentId" name="parentId" class="form-control" style="width: 25%; float:right; margin-bottom:  10px;" onchange = "redirectlink('<?php echo base_url()."admin/services/index/";?>'+ this.value);" >
    <option value="0">Services</option>
    <?php
        foreach($parents as $key=>$value){
    ?>
    <option value="<?php echo $value['servicesId']?>" <?php if($value['servicesId'] == $option) echo 'selected';?> ><?php echo $value['title']?></option>
    <?php
        }
    ?>
</select>

<table class="table table-hover table-bordered">
    <thead>
        <tr>
            <th width="5%">#</th>
            <th width="40%">Title</th>
            <th width="40%">Slug</th>
            <th width="15%">Actions</th>
        </tr>
    </thead>
    <tbody>
        <?php
        if(isset($data) && !empty($data)){
            foreach($data as $key=>$value){
        ?>
        <tr>
            <td><?php echo $value['servicesId']; ?></td>
            <td><?php echo $value['title']; ?></td>
            <td><?php echo $value['slug']; ?></td>
            <td>
                <a href="<?php echo base_url()?>admin/services/edit/<?php echo $value['id']; ?>">Edit</a>
                <a rel="<?php echo base_url()?>admin/services/delete/<?php echo $value['servicesId']; ?>" href="#" class="confirmDelete">Delete</a>
            </td>
        </tr>
        <?php }} ?>
    </tbody>
</table>


<script type="text/javascript">
function redirectlink(url){
    window.location.href=url;
}
</script>